<?php
/* @var $this TvchannelController */
/* @var $model Tvchannel */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'tvchannel-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
	'htmlOptions'=>array('enctype'=>'multipart/form-data'),
	
)); ?>

	<p class="note">
	<?php echo Yii::t('base','Fields with <span class="required">*</span> are required.');?>
	</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'tv_id'); ?>
		<?php echo $form->dropDownlist($model,'tv_id',Tvchannel::model()->getTvShowTvId());?>
		<?php echo $form->error($model,'tv_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'channel_name'); ?>
		<?php echo $form->textField($model,'channel_name',array('size'=>60,'maxlength'=>300)); ?>
		<?php echo $form->error($model,'channel_name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'channel_url'); ?>
		<?php echo $form->textField($model,'channel_url',array('size'=>60,'maxlength'=>500)); ?>
		<?php echo $form->error($model,'channel_url'); ?>
	</div>


	<div class="row">
		<?php echo $form->labelEx($model,'sort'); ?>
		<?php echo $form->textField($model,'sort'); ?>
		<?php echo $form->error($model,'sort'); ?>
	</div>

	
	<div class="row">
	<?php echo $form->labelEx($model,'tv_img'); ?>
	<?php //echo $form->textField($model,'tv_img',array('size'=>300,'maxlength'=>500)); ?>
	<?php echo '<img src="'.$model->tv_img.'"    width="20%"/>'; ?>
	<?php echo CHtml::activeFileField($model,'tv_img'); ?>
	<?php if(!$model->isNewRecord){?>
	<input type="hidden"   name="tv_img2"   id="hiddenField"    value="<?php echo $model->tv_img;?>"/>
	<?php }?>
	<?php echo $form->error($model,'tv_img'); ?>
	</div>


	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? Yii::t('base','Create') : Yii::t('base','Save')); ?>
	</div>

	

<?php $this->endWidget(); ?>

</div><!-- form -->